import AV from 'leancloud-storage';

export function getQuestion() {
    const query = new AV.Query('Question');
    // query.equalTo('categoryId','5a479058ee920a0045b4d91b');
    const category = AV.Object.createWithoutData('Category','5a479058ee920a0045b4d91b');
    query.equalTo('categoryId',category);
    return query.find()
//         .then((result)=>{
//         console.log(result)
//     },(error)=>{
// console.error(error)
//     })
}

export function getQuestionById(id) {
    const query = new AV.Query('Question');
    return new Promise((resolve,reject)=>{
        query.get(id).then(resolve,reject)
    })
}